package com.example.leetcode.graph;

import com.example.leetcode.graph.common.GraphUtils;

class Solution505 {
    public int shortestDistance(int[][] maze, int[] start, int[] destination) {
//        return GraphUtils.shortestDistance(maze, start, destination);
//        return GraphUtils.shortestDistance2(maze, start, destination);
        return GraphUtils.shortestDistance3(maze, start, destination);
    }
}

public class leetcode505 {
    public static void main(String[] args) {
        Solution505 solution505 = new Solution505();
        int[][] maze = {
                {0, 0, 1, 0, 0},
                {0, 0, 0, 0, 0},
                {0, 0, 0, 1, 0},
                {1, 1, 0, 1, 1},
                {0, 0, 0, 0, 0}
        };
        int[] start = {0, 4};
        int[] destination = {4, 4};
        System.out.println(solution505.shortestDistance(maze, start, destination));
    }
}
